<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateTableCouponLog extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('luck_coupon_log', function (Blueprint $table) {
            $table->id();
            $table->integer('luck_id')->unsigned()->default(0)->comment('抽奖券ID');
            $table->integer('user_id')->unsigned()->default(0)->comment('用户ID');
            $table->integer('activity_id')->unsigned()->default(0)->comment('活动ID');
            $table->integer('luck_sum')->unsigned()->default(0)->comment('每张券的发放数量');
            $table->string('luck_name')->default('')->comment('抽奖券名');
            $table->string('user_name')->default('')->comment('用户名');
            $table->timestamp('get_time')->comment('领取时间');
            $table->timestamps();
        });
        DB::statement('alter table ex_luck_coupon_log comment "抽奖券发放记录表"');
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('coupon_log');
    }
}
